<html>
  <head>
    <title>Text Entry</title>
  </head>
  <body>
    <h1>Text Entry</h1>
    
    <p>Input: <input id="input" onkeypress="eventually(reverseText);"/>
    <p>Reversed: <span id="reversed"></span></p>
	
    <script type="text/javascript">
    	function reverseText() {
    		input = document.getElementById("input").value;
			
			reversed = ""
    		for (i in input) {
    			reversed = input[i] + reversed;
    		}
    		
    		document.getElementById("reversed").textContent = reversed;
    	}
    	
    	function eventually(f) {
    		setTimeout(f, 500);
    	}
    </script>
  </body>
</html>
